﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Ebada.UI.Base;
using Ebada.Platform.Model;

namespace Ebada.Modules.Vehicle
{
    public partial class frmStatSelector : FormBase
    {
        public frmStatSelector()
        {
            InitializeComponent();
            this.ucOrg1.bar1.Visible = false;
            //this.ucOrg1.hideCol();
            this.ucOrg1.gridView1.DoubleClick += new EventHandler(gridView1_DoubleClick);
        }

        void gridView1_DoubleClick(object sender, EventArgs e)
        {
            this.selectObj = this.ucOrg1.gridView1.GetFocusedRow() as VehicleGasStation;

            if (this.selectObj == null)
            {
                return;
            }
            else
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }

        private VehicleGasStation selectObj = null;

        public VehicleGasStation SelectObj
        {
            set { selectObj = value; }
            get { return selectObj; }
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            if (ucOrg1.gridView1.GetFocusedRow()==null){
                MessageBox.Show("请选择加油站。","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
                return;
            }
            this.selectObj = this.ucOrg1.gridView1.GetFocusedRow() as VehicleGasStation;
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void frmOrgSelector_Load(object sender, EventArgs e)
        {
             //this.ucOrg1.ParentData = null; 
        }

        public void IntionDataAll()
        {
            //this.ucOrg1.ParentData = null; 
        }
        public void IntionData(string where)
        {
          
        }
    }
}